﻿using ArtheaEngine;

namespace ArtheaServer.Commands
{
    public class ForceCommand : Command
    {
        public ForceCommand()
            : base("force", "Forces another character to do something.", World.IMMORTAL)
        {
        }

        public override void Execute(Character ch, Argument argument)
        {
            if (argument.IsEmpty())
            {
                ch.WriteLine("Force whom to do what?");
                return;
            }

            string arg = argument.FirstArg();

            Character vict = World.GetChar(arg);

            if (vict == null)
            {
                ch.WriteLine("No such character.");
                return;
            }

            if (argument.IsEmpty())
            {
                ch.WriteLine("Force {0} to do what?", vict);
                return;
            }

            ch.WriteLine("Forcing {0} to '{1}'...", vict, argument);

            Interpret(vict, argument);
        }
    }
}